package Day004.ZuoYe01;

import java.util.ArrayList;
import java.util.Date;
import java.util.Random;

public class Test09 {
    public static void main(String[] args) {

        ArrayList<Integer> list = new ArrayList();

        //for循环前的时间
        Date date1 = new Date();
        long time1 = date1.getTime();
        for (int i = 0; i < 10000000; i++) {

            Random ran = new Random();
            int a = ran.nextInt(100);
            list.add(a);
        }
        //for循环结束时间
        Date date2 = new Date();
        long time2 = date2.getTime();

        System.out.println(time2-time1); //700 704 705 703 778 766 699ms
    }
}
